Skip to content

feat(mockups): add Therapy Compass decision-support mockup#646

Merged
BigSimmo merged 2 commits into
mainfrom
claude/therapy-compass-pages-rz0m5l
Jul 14, 2026
Merged

feat(mockups): add Therapy Compass decision-support mockup#646
BigSimmo merged 2 commits into
mainfrom
claude/therapy-compass-pages-rz0m5l

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Summary

Adds Therapy Compass — a source-grounded therapy decision-support mockup — as a dev-only route at /mockups/therapy-compass, adapted from the claude.ai/design "Therapy page mockups" project (Therapy Compass.dc.html).

Eight screens with full client-side wiring:

  • Home – search hero, quick tools, key pathways, frequently-used therapies
  • Search – result cards (why-matched / avoid-modify / best-fit) + clinical workbench
  • Detail – therapy record (hero, quick tiles, body sections, right rail, source provenance)
  • Compare – 3-way comparison grid with Priorities/Differences/All tabs + comfortable/dense density toggle
  • Recommend – constraint builder + ranked clinical matches
  • Pathways – problem-based workflow with linked therapy steps
  • Brief Intervention – 5-min / 15-min / grounding tabs, delivery steps, pre-use checklist
  • Patient Sheet – live builder (tone, section toggles, clinician footer) with a printable "paper" preview + Print/PDF
  • Review Queue – placeholder surface (shared isOther fallback)

Fitted to the app's chrome, not ported verbatim. The content renders inside the app's universal chrome — global header + sidebar (via the mockups layout) and the shared clinical verification footer (ModeHomeVerificationFooter). The design's own left sidebar was intentionally dropped (that role is already filled by the universal rail); its eight destinations are reached through a horizontal, repo-idiomatic pill nav that sits under the global header and scrolls on narrow viewports. The shared bottom search composer is hidden (as with the tools/favourites mockups) since the tool provides its own search surface.

Implementation note: the screens keep the design export's token-based inline styles. Every var(--…) token already exists in globals.css and flips in dark mode; a small s() helper parses the CSS strings at render so the markup stays close to the design (and off the Tailwind type/icon-scale gates, which only flag arbitrary utilities). Two hardcoded body-text colours were mapped to --warning-text / --info-text for dark-mode correctness; the patient-sheet "paper" keeps its intentional print colours. Design-nav anchors were promoted to accessible <button>s and layout-only <label>s to <div>s with aria-labeled inputs.

Verification

Dev-only mockup (production returns 404, robots disallows indexing). Ran:

  • npm run lint (clean, --max-warnings 0), Prettier --check (clean), sitemap:check (route registered)

  • typecheck — clean for every new file (the only tsc errors in this sandbox are pre-existing and come from optional deps not installed here: @sentry/node, @testing-library/*, @axe-core/playwright)

  • ✅ Browser QA via Chromium/Playwright — all 8 screens + placeholder, light and dark, verified rendering inside the universal chrome; screen navigation, comparison tabs, density, brief tabs, sheet section/tone toggles and the clinician toggle all confirmed working, no React console warnings

  • npm run verify:pr-local — not run to completion in this sandbox (its typecheck step trips on the missing optional deps above, unrelated to this change); the individual gates above were run directly. CI Build / Static PR checks cover these with a full install.

  • npm run verify:ui — full Chromium e2e suite not run locally; equivalent manual browser QA performed instead (CI Critical UI smoke / UI regression cover it).

Clinical Governance Preflight

N/A — this is a static, dev-only design mockup. It does not touch ingestion, answer generation, search/ranking, source rendering, document access, privacy, production env, Supabase, or clinical output. All copy is placeholder design content; no real or patient-identifiable data, no service-role/provider access, and no schema changes.

Notes

Two commits: (1) the initial port of the eight screens; (2) a refactor that drops the design's own sidebar for the horizontal in-content nav so the tool fits the app's universal chrome. Screens were converted from the design export's x-dc template (inline-styled HTML + a small state script) into React with a context (TcProvider / useTcBindings) that mirrors the export's renderVals() state — screen routing, comparison tabs, density, brief tabs, patient-sheet tone/sections, clinician toggle and print.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TJaXJntdH7Q98ejoSZF46K

Summary by CodeRabbit

  • New Features

    • Added the Therapy Compass clinical tool prototype.
    • Added therapy search, recommendations, comparisons, clinical pathways, briefs, therapy details, and patient sheet creation.
    • Added customizable patient handouts with editable sections, tone options, and print/PDF support.
    • Added responsive navigation and clinical verification information across screens.
  • Documentation

    • Added the Therapy Compass route to the site map.

Port the "Therapy Compass" design (claude.ai/design "Therapy page mockups")
into a runnable, dev-only mockup route with eight screens — Home, Search,
Detail, Compare, Recommend, Pathways, Brief Intervention and Patient Sheet —
plus a Review-Queue placeholder. Client-side wiring covers screen navigation,
comparison tabs/density, brief tabs, patient-sheet tone/section toggles, the
clinician-footer toggle and print.

The screens are a faithful port of the design export's token-based inline
styles: every var(--…) already exists in globals.css and flips in dark mode,
and a small s() helper parses the CSS strings at render so the markup stays
1:1 with the design (this also keeps it off the Tailwind type/icon-scale
gates, which only flag arbitrary utilities).

It renders inside the app's universal chrome — global header + rail via the
mockups layout — and closes with the shared clinical verification footer
(ModeHomeVerificationFooter); the tool's own navigation sits between them as
a secondary rail. The shared bottom search composer is hidden (as with the
tools/favourites mockups) since the tool provides its own search surface.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TJaXJntdH7Q98ejoSZF46K
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 75e273c8-1736-489e-9c79-0ee861121253

📥 Commits

Reviewing files that changed from the base of the PR and between 71d9f2c and 27c6bbc.

📒 Files selected for processing (18)
  • docs/site-map.md
  • src/app/mockups/mockups-layout-client.tsx
  • src/app/mockups/therapy-compass/page.tsx
  • src/components/therapy-compass/bindings.tsx
  • src/components/therapy-compass/index.ts
  • src/components/therapy-compass/nav.tsx
  • src/components/therapy-compass/screens/brief-screen.tsx
  • src/components/therapy-compass/screens/compare-screen.tsx
  • src/components/therapy-compass/screens/detail-screen.tsx
  • src/components/therapy-compass/screens/home-screen.tsx
  • src/components/therapy-compass/screens/other-screen.tsx
  • src/components/therapy-compass/screens/pathways-screen.tsx
  • src/components/therapy-compass/screens/recommend-screen.tsx
  • src/components/therapy-compass/screens/search-screen.tsx
  • src/components/therapy-compass/screens/sheets-screen.tsx
  • src/components/therapy-compass/style-utils.ts
  • src/components/therapy-compass/styles.tsx
  • src/components/therapy-compass/therapy-compass-page.tsx

📝 Walkthrough

Walkthrough

Changes

The PR adds a Therapy Compass mockup route with shared state bindings, navigation, multiple clinical workflow screens, responsive styling, and a printable patient-sheet builder. The route is integrated into the sitemap and hides the shared mockup composer.

Therapy Compass mockup

Layer / File(s) Summary
Route and mockup integration
docs/site-map.md, src/app/mockups/..., src/components/therapy-compass/index.ts
Adds the route metadata, sitemap entry, page export, and composer visibility handling.
Bindings, shell, and navigation
src/components/therapy-compass/bindings.tsx, nav.tsx, therapy-compass-page.tsx, style-utils.ts, styles.tsx
Adds shared screen state, navigation bindings, screen selection, scoped styling, responsive rules, and print rules.
Discovery and recommendation screens
src/components/therapy-compass/screens/home-screen.tsx, search-screen.tsx, recommend-screen.tsx
Adds home, therapy search, and recommendation interfaces with bound navigation actions.
Clinical workflow screens
src/components/therapy-compass/screens/detail-screen.tsx, compare-screen.tsx, pathways-screen.tsx, brief-screen.tsx
Adds therapy detail, comparison, clinical pathways, and brief-intervention interfaces with cross-screen actions.
Patient sheet builder and printing
src/components/therapy-compass/screens/sheets-screen.tsx
Adds tone and section controls, editable patient-facing content, clinician footer fields, and print/PDF behavior.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Route
  participant TherapyCompassPage
  participant TcProvider
  participant Shell
  participant Screen
  Route->>TherapyCompassPage: render Therapy Compass route
  TherapyCompassPage->>TcProvider: initialize screen and UI state
  TcProvider->>Shell: provide TcBindings
  Shell->>Screen: render active screen
  Screen->>TcProvider: invoke navigation or control handler
Loading
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/therapy-compass-pages-rz0m5l

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed: one or more packages not found in the registry.


Comment @coderabbitai help to get the list of available commands.

@supabase

supabase Bot commented Jul 14, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@BigSimmo
BigSimmo marked this pull request as ready for review July 14, 2026 08:02
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@BigSimmo
BigSimmo enabled auto-merge (squash) July 14, 2026 08:02
…nt nav

The design shipped a bespoke left rail, but inside this app that role is
already filled by the universal sidebar. Remove the tool's own vertical rail
and keep its eight destinations reachable through a horizontal, repo-idiomatic
pill nav that sits at the top of the content (sticky under the global header)
and scrolls horizontally on narrow viewports. This fits the tool into the
app's chrome rather than porting the design's chrome verbatim.

Also switch the nav pill's active border to the `border` shorthand in both
states so React no longer warns about mixing `border`/`borderColor` across
rerenders.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TJaXJntdH7Q98ejoSZF46K
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants